package com.example.Controller;

public enum Color {
    // 基本颜色
    RED("红色", "Red", "#FF0000"),
    GREEN("绿色", "Green", "#00FF00"),
    BLUE("蓝色", "Blue", "#0000FF"),
    YELLOW("黄色", "Yellow", "#FFFF00"),
    BLACK("黑色", "Black", "#000000"),
    WHITE("白色", "White", "#FFFFFF"),

    // 常用拓展颜色
    GRAY("灰色", "Gray", "#808080"),
    PINK("粉色", "Pink", "#FFC0CB"),
    PURPLE("紫色", "Purple", "#800080"),
    ORANGE("橙色", "Orange", "#FFA500"),
    BROWN("棕色", "Brown", "#A52A2A"),
    CYAN("青色", "Cyan", "#00FFFF");

    // 颜色中文名称
    private final String chineseName;
    // 颜色英文名称
    private final String englishName;
    // 十六进制色值
    private final String hexCode;

    // 构造方法
    Color(String chineseName, String englishName, String hexCode) {
        this.chineseName = chineseName;
        this.englishName = englishName;
        this.hexCode = hexCode;
    }

    // Getter 方法
    public String getChineseName() {
        return chineseName;
    }

    public String getEnglishName() {
        return englishName;
    }

    public String getHexCode() {
        return hexCode;
    }

    // 可选：根据十六进制色值获取枚举（方便业务查询）
    public static Color getByHexCode(String hexCode) {
        for (Color color : values()) {
            if (color.hexCode.equalsIgnoreCase(hexCode)) {
                return color;
            }
        }
        return null; // 或抛出异常
    }
}